package com.penghaisoft.microwms.common;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by zxcq0 on 2017/3/1.
 */
public class Constant {

	public static final SimpleDateFormat sdfYMDHMS = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	public static final SimpleDateFormat sdfYMD = new SimpleDateFormat("YYMMdd");

	public static final String SERIALNO = "wms:serial";
	public static final String SUCCESS = "1";
	public static final String FAIL = "0";
	public static final String NO_AUTHC = "-1";// 未登录
	public static final String NO_AUTHZ = "-2";// 未授权
	public static final String CODE = "code";
	public static final String MESSAGE = "message";
	public static final String TRUE = "true";

	/**
	 * 默认工厂
	 */
	public static final String DEFAULT_FACTORY_CODE = "1001";

	/**
	 * 默认库位【成品】
	 */
	public static final String PRO_DEFAULT_WL_CODE = "成品货场二库位一";

//    区间转换类型
	public static final int FROM_TO_DATE = 1;
	public static final int FROM_TO_NUM = 2;

	// response code
	public static final String CODE_ONE = "1";
	public static final String CODE_TWO = "2";
	public static final String CODE_THREE = "3";
	public static final String CODE_FOUR = "4";
	public static final String CODE_FIVE = "5";
	public static final String CODE_SIX = "6";
	public static final String CODE_SEVEN = "7";
	public static final String CODE_EIGHT = "8";
	public static final String CODE_NINE = "9";
	public static final String CODE_TEN = "10";
	public static final String CODE_ELEVEN = "11";
	public static final String CODE_TWELVE = "12";
	public static final String CODE_THIRTEEN = "13";
	public static final String CODE_FOURTEEN = "14";
	public static final String CODE_FIFTEEN = "15";

	public static final String RSP_LEVEL_ALERT = "alert";
	public static final String RSP_LEVEL_VALIDATE = "validate";
	public static final String RSP_LEVEL_NONE = "none";

	public static final String DATA_AUTH_PREFIX = "dataAuth:";

	public static final String DICTIONARY_DICTYPE = "dictionary:dictype:";

	// 系统资源模块类型
	public static final String SYSTEM_DICTYPE = "cosmo_branch";

	/**
	 * @Fields HANDKEY : 存放手持用户信息的key
	 */
	public final static String HANDKEY = "handUser";

	/**
	 * 当前工厂内所有的用户
	 */
	public final static String FACTORY_USER_KEY = "wms:users:";

	/**
	 * 集团用户
	 */
	public final static String USER_TYPE_GROUP = "1";
	/**
	 * 工厂用户
	 */
	public final static String USER_TYPE_FACTORY = "2";

	/**
	 * 螺纹钢管【型号类型-原材料】螺旋钢管
	 */
	public static final String MODEL_L = "LX";

	/**
	 * 无缝钢管【型号类型-原材料】
	 */
	public static final String MODEL_W = "WF";
	/**
	 * 直缝钢管【型号类型-原材料】
	 */
	public static final String MODEL_Z = "ZF";
	
	/**
	 * 裸镀锌管【型号类型-原材料】
	 */
	public static final String MODEL_LDXG = "LDXG";
	
	/**
	 * PE管【型号类型-原材料】
	 */
	public static final String MODEL_PE = "PE";
	
	/**
	 * 镀锌风管--PE管【型号类型-原材料】
	 */
	public static final String MODEL_DXF = "DXF";
	
	/**
	 * 镀铝风管--PE管【型号类型-原材料】
	 */
	public static final String MODEL_DLF = "DLF";
	
	/**
	 * 铝合金风管--PE管【型号类型-原材料】
	 */
	public static final String MODEL_LHF = "LHF";
	public static List<String> PE_LIST = Arrays.asList(MODEL_PE, MODEL_DXF, MODEL_DLF, MODEL_LHF);

	/**
	 * 白料【型号类型-原材料】
	 */
	public static final String MODEL_B = "BL";

	/**
	 * 黑料【型号类型-原材料】
	 */
	public static final String MODEL_H = "HL";

	/**
	 * 保温棉【型号类型-原材料】
	 */
	public static final String MODEL_BW = "BW";
	/**
	 * 辅料【型号类型-原材料】
	 */
	public static final String MODEL_FL = "FL";

	/**
	 * 玻璃钢树脂【型号类型-原材料】
	 */
	public static final String MODEL_BZ = "BZ";

	/**
	 * 玻璃丝布【型号类型-原材料】
	 */
	public static final String MODEL_BB = "BB";

	/**
	 * 弯头【型号类型-原材料】
	 */
	public static final String MODEL_WT = "WT";
	/**
	 * 三通【型号类型-原材料】
	 */
	public static final String MODEL_ST = "ST";
	/**
	 * 变径【型号类型-原材料】
	 */
	public static final String MODEL_BJ = "BJ";
	/**
	 * 固定支架【型号类型-原材料】
	 */
	public static final String MODEL_GD = "GD";
	/**
	 * 热熔套【型号类型-热熔套、堵头】
	 */
	public static final String MODEL_RRT = "C-RRT";
	/**
	 * 堵头【型号类型-热熔套、堵头】
	 */
	public static final String MODEL_DUT = "C-DUT";

	/**
	 * 塑套钢-螺旋钢管【型号类型-成品】
	 */
	public static final String PRO_MODEL_STG_L = "C-STG-L";

	/**
	 * 塑套钢-无缝钢管【型号类型-成品】
	 */
	public static final String PRO_MODEL_STG_W = "C-STG-W";

	/**
	 * 塑套钢-直缝钢管【型号类型-成品】
	 */
	public static final String PRO_MODEL_STG_Z = "C-STG-Z";

	/**
	 * 塑套钢-镀锌管【型号类型-成品】
	 */
	public static final String PRO_MODEL_STG_DX = "C-STG-DX";

	/**
	 * 钢套钢(外滑)-螺旋钢管【型号类型-成品】
	 */
	public static final String PRO_MODEL_GTGW_L = "C-GTGW-L";
	
	/**
	 * 钢套钢(内滑)-螺旋钢管【型号类型-成品】
	 */
	public static final String PRO_MODEL_GTGN_L = "C-GTGN-L";

	/**
	 * 钢套钢(外滑)-无缝钢管【型号类型-成品】
	 */
	public static final String PRO_MODEL_GTGW_W = "C-GTGW-W";
	
	/**
	 * 钢套钢(内滑)-无缝钢管【型号类型-成品】
	 */
	public static final String PRO_MODEL_GTGN_W = "C-GTGN-W";

	/**
	 * 玻璃钢-螺旋钢管【型号类型-成品】
	 */
	public static final String PRO_MODEL_BLG_L = "C-BLG-L";

	/**
	 * 玻璃钢-无缝钢管【型号类型-成品】
	 */
	public static final String PRO_MODEL_BLG_W = "C-BLG-W";
	
	/**
	 * 螺旋风管保温管-铝合金【型号类型-成品】
	 */
	public static final String PRO_MODEL_LXF_LH = "C-LXF-LH";
	/**
	 * 镀锌螺旋风管-铝合金【型号类型-成品】
	 */
	public static final String PRO_MODEL_LXF_DX = "C-LXF-DX";
	/**
	 * 镀铝螺旋风管-铝合金【型号类型-成品】
	 */
	public static final String PRO_MODEL_LXF_DL = "C-LXF-DL";

	/**
	 * 成品型号类型
	 */
	public static final String MODEL_TYPE_P = "model_type_p";

	/**
	 * 手工入库前缀
	 */
	public static final String PRO_HANDIN_PREFIX = "wms:handin:";

	/**
	 * 下线入库前缀
	 */
	public static final String PRO_DOWNLINEIN_PREFIX = "wms:downlinein:";

	/**
	 * 原材料入库前缀
	 */
	public static final String RAW_INWH_PREFIX = "wms:rawinwh:";

	/**
	 * 原材料条码生成前缀
	 */
	public static final String RAW_BARCODE_PREFIX = "wms:raw:barcode:";
	/**
	 * 成品条码生成前缀
	 */
	public static final String PRO_BARCODE_PREFIX = "wms:pro:barcode:";

	/**
	 * 成品积压库存入库前缀
	 */
	public static final String PRO_INWH_PREFIX = "wms:proinwh:";

	/**
	 * 销售出库前缀
	 */
	public static final String PRO_SELLOUT_PREFIX = "wms:sellout:";

	/**
	 * 原材料合同借用前缀
	 */
	public static final String RAW_HTJY_PREFIX = "wms:htjy:";
	
	/**
	 * 成品合同借用前缀
	 */
	public static final String PRO_HTJY_PREFIX = "wms:prohtjy:";

	/**
	 * 报废出库前缀
	 */
	public static final String PRO_SCRAPOUT_PREFIX = "wms:scrapout:";

	/**
	 * 手持扫码失效时间
	 */
	public static final int PRO_HAND_LOST_MINUTES = 3;
	/**
	 * 成品型号类型-弯头
	 */
	public static final String PRO_MODEL_TYPE_WT = "C-GUJ-W";
	/**
	 * 成品型号类型-三通
	 */
	public static final String PRO_MODEL_TYPE_ST = "C-GUJ-S";
	/**
	 * 成品型号类型-变径
	 */
	public static final String PRO_MODEL_TYPE_BJ = "C-GUJ-B";
	/**
	 * 成品型号类型-固定支架
	 */
	public static final String PRO_MODEL_TYPE_G = "C-GUJ-G";
	/**
	 * 成品型号类型-补偿器
	 */
	public static final String PRO_MODEL_TYPE_C = "C-GUJ-C";
	/**
	 * 成品非管件入库出库时，总需求米数不超过的固定米数
	 */
	public static final BigDecimal PRO_STATIC_METER = new BigDecimal(1);
	
	/**
	 * 成品 手工出库、手工入库、合同借用 中实发数量 比 需求数量 最多多的长度
	 */
	public static final BigDecimal PRO_MAX_STATIC_METER = new BigDecimal(5);
	
	/**
	 * 原材料 手工出库、合同借用、返修出库 中实发数量 比 需求数量 最多多的长度
	 */
	public static final BigDecimal RAW_MAX_STATIC_METER = new BigDecimal(5);

	/**
	 * 成品短前缀
	 */
	public static final String SEQ_PREFIX_SHORT_REDIS = "wms:seq:proshort:";

	public static final String SEQ_PREFIX_REDIS = "wms:seq:";

	public static final String SEQ_PREFIX_SHORT_REDIS_PRO_SGR = "-cpsgr";

	public static final String SEQ_PREFIX_SHORT_SGR = "SGR";

	public static final String SEQ_PREFIX_SHORT_REDIS_PRO_XSC = "-cpxsc";

	public static final String SEQ_PREFIX_SHORT_REDIS_RAW_YJY = "-ycljy";
	public static final String SEQ_PREFIX_SHORT_REDIS_PRO_CJY = "-cpjy";

	public static final String SEQ_PREFIX_SHORT_XSC = "XSC";

	public static final String SEQ_PREFIX_SHORT_YJY = "YJY";
	
	public static final String SEQ_PREFIX_SHORT_CJY = "CJY";

	public static final String SEQ_PREFIX_SHORT_REDIS_MAT_SGC = "-yclsgc";

	public static final String SEQ_PREFIX_SHORT_REDIS_MAT_CSGC = "-cpsgc";

	public static final String SEQ_PREFIX_SHORT_SGC = "YSGC";

	public static final String SEQ_PREFIX_SHORT_CSGC = "CSGC";

	public static final String SEQ_PREFIX_SHORT_REDIS_MAT_PD = "-yclpd";

	public static final String SEQ_PREFIX_SHORT_REDIS_PRO_PD = "-cppd";

	public static final String SEQ_PREFIX_SHORT_PD = "PD";

	public static final String SEQ_PREFIX_SHORT_DJ = "DJ";

	public static final String SEQ_PREFIX_SHORT_PRO_DJ = "DJ-CPJY";

	public static final String SEQ_PREFIX_SHORT_REDIS_RAW_DJ = "-dj";

	public static final String SEQ_PREFIX_SHORT_REDIS_PRO_DJ = "-cpdj";

	/**
	 * 监控地址
	 */
	public static final String MONITOR_KEY = "wms:monitor";

	/**
	 * 模块
	 */
	public static final String MODULE_KEY = "wms:module";

	public static final String INIT_PWD = "123456";

	public static final BigDecimal X = new BigDecimal("0.3");

	public static final BigDecimal MIN = new BigDecimal("0.3");

	public static final BigDecimal MAX = new BigDecimal("0.35");

	public static final double MIN_L = 0.2;

	public static final double MAX_L = 0.5;
	
	public static final double MIN_L1 = 0 - 0.1;

	public static final double MAX_L1 = 0;

//    public static final double MIN_W = 0.2;
//
//    public static final double MAX_W = 0.4;

	public static final double MIN_W = 0 - 0.4;

	public static final double MAX_W = 0.4;

	public static final BigDecimal PE_DIFF = new BigDecimal("20");

	public static final BigDecimal KULING_OFF = new BigDecimal("50");

	public static final double OUTHOUR = 24;
}
